Catch ARGTYPE_INT arguments with defaults that aren't integers.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sat, 10 Dec 2005 20:35:21 +0000 (20:35 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sat, 10 Dec 2005 20:35:21 +0000 (20:35 +0000)
gpsbabel/vecs.c

index 0cf5a402d563b42c82e8e62d2c2fc375a9500c0b..679b37803bd43a1fd52c3b105fc8c883cca7fa0e 100644 (file)
@@ -501,6 +501,11 @@ exit_vecs( void )
                }
                if ( vec->vec->args ) {
                        for ( ap = vec->vec->args; ap->argstring; ap++ ) {
+                               if ( ap->defaultvalue && 
+                                       ( ap->argtype == ARGTYPE_INT ) &&
+                                       ! isdigit(ap->defaultvalue[0])) {
+                                       warning("%s: not an integer\n", ap->argstring);
+                               }
                                if ( ap->argval && *ap->argval ) {
                                        xfree(*ap->argval);
                                        *ap->argval = NULL;